using System;
using System.Collections.Generic;
using System.Text;

namespace wicGeneral
{
    public static class FileInfo
    {
        public static string GetFileName(string path)
        {
            if (path.Contains("\\"))
            {
                string[] arr = path.Split('\\');
                return arr[arr.Length - 1];
            }
            else
            {
                string[] arr = path.Split('/');
                return arr[arr.Length - 1];
            }
        }
        public static string GetFileExt(string filename)
        {
            return filename.Substring(filename.LastIndexOf(".") + 1);
        }
        public static string GetDirectory(string filename)
        {
            if (filename.Contains("\\"))
            {
                return filename.Substring(0, filename.LastIndexOf("\\")+1);
            }
            else
            {
                return filename.Substring(0, filename.LastIndexOf("/")+1);
            }
        }
    }
}
